1. Field
One or more embodiments of the present invention relate to image encoding and decoding, and more particularly, to an apparatus for encoding an image by using multi-layer entropy encoding and an apparatus for decoding an image.
2. Description of the Related Art
In general, a still image or a moving image is encoded by performing entropy encoding on quantized coefficients. Entropy encoding involves scanning quantized coefficients of a predetermined unit, for example, a frame, in a zigzag pattern, performing run length encoding to generate run length symbols, and mapping the run length symbols to codewords by performing variable length coding to form bitstreams. Such entropy encoding is based on the fact that quantized coefficients are mostly located in a region corresponding to low frequency components and most coefficients after quantization become zero. That is, a scanning pattern is determined by considering the distribution of the quantized coefficients, and run length encoding is performed to efficiently encode the coefficients that become zero (0) after quantization. However, when the quantized coefficients are obtained from residue data generated from results of predictive encoding, the distribution of the quantized coefficients is changed, such that, instead of being mostly located in a region corresponding to low frequency components, the coefficients may tend to be uniformly distributed in both regions corresponding to low and high frequency components. That is, since the residue data obtained through the predictive encoding does not include information on distribution characteristics with respect to frequency components which are considered in entropy encoding, it is difficult to achieve a desired compression rate through the entropy encoding.